<meta charset="utf-8" />
<?php
require ('../../ht/Common/dbConn.php');
connect();
//使用$_POST数组获取表单中输入的数据
$uname = trim($_POST['uname']);
$password = $_POST['password'];
//插入数据库
$sql="insert into users values
 (0,1,'$password','$uname',1,'2019-1-1',0,0,0,0,0)";
//执行SQL语句
$result = mysql_query($sql) or die('插入失败！'.mysql_error());
//判断是否插入成功
$num = mysql_affected_rows();
if($num!=1){
    echo "注册失败！2秒后返回";
     header("refresh:2;url='../qt_login/qt_login.php'");
}else{
    header("location:../qt_index.php");
}
//关闭数据库
mysql_close();

?>
